package com.ian.starter.config;

import com.ian.starter.property.SmsProperties;
import com.ian.starter.service.SmsService;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @desc 短信自动配置类
 *
 * @author 张伟
 * @date 2022/1/24
 */
@Configuration
// 使@ConfigurationProperties注解生效
@EnableConfigurationProperties(SmsProperties.class)
public class SmsAutoConfiguration {
    @Bean
    public SmsService smsService(SmsProperties smsProperties) {
        return new SmsService(smsProperties);
    }
}
